'''
Created on 03.08.2011

@author: osman
'''

import opf

# create new ontology Pets:
Pets = opf.Ontology(uri = '  http://www.example.com/pets   ',
                        en = 'Pets',
                        ru = 'ДомашниеЖивотные')

# create abstract class Pet in ontology Pets:
@Pets.abstract
class Pet:
    # define __init__, __repr__, __str__ and any other methods as usual:
    def __init__(self, nickname): self.nickname = nickname
    def __repr__(self): return self.__class__.__name__ + " " + self.nickname
    def __str__(self): return self.nickname

# create class Cat in ontology Pets:
@Pets
class Cat(Pet): pass

# create class Dog in ontology Pets:
@Pets
class Dog(Pet): pass

# create class OtherPet in ontology Pets:
@Pets
class OtherPet(Pet): pass

# declare that existing classes are disjoint in this ontology:
Pets.disjoint(Cat, Dog, OtherPet)
